package nowcoder;
/**
 * MP3光标位置
 */
import java.util.*;
public class Day21_2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        String str = input.next();
        char[] s = str.toCharArray();
        input.close();

        int cur = 1, start = 1;
        // n <= 4
        if(n <= 4){
            for (int i = 0; i < s.length; i++) {
                if(s[i] == 'U'){
                    if(cur == 1){
                        cur = n;
                    }else{
                        cur --;
                    }
                }else{
                    if(cur == n){
                        cur = 1;
                    }else{
                        cur ++;
                    }
                }
            }

            //输出
            for (int i = 1; i <= n; i++) {
                System.out.print(i + " ");
            }
            System.out.println();
            System.out.println(cur);
            return;
        }

        // n > 4
        for (int i = 0; i < s.length; i++) {
            if(s[i] == 'U'){
                // 上翻操作
                if(cur == 1){
                    // cur和start都在第一首歌的位置
                    cur = n;
                    start = n - 3;
                }else if(cur == start){
                    // 不在第一首歌处，但位置一样
                    cur --;
                    start --;
                }else{
                    // cur和start不在同一位置
                    cur --;
                }
            }else{
                // 下滑操作
                if(cur == n){
                    // cur在最后一首歌的位置
                    cur = 1;
                    start = 1;
                }else if(cur == start + 3){
                    cur ++;
                    start ++;
                }else{
                    cur ++;
                }
            }
        }

        System.out.println(start + " " + (start+1) + " " + (start+2) + " " + (start+3));
        System.out.println(cur);
    }
}
